function updateQuestionStatus(id,status) {
	var str = '';
	if(status==2){
		str = '关闭此问题，此问题将不再接受新的答案';
	}else if(status==-1){
		str = '删除此问题，此问题将不再接受新的答案';
	}else{
		return;
	}
	var crf = window.confirm(str);
	if(!crf){
		return;
	}
	$.getJSON("/faq/updateQuestionStatus.json",{questionid: id, status:status}, function(result) {
		window.top.location.reload();
	});
}

function addQuestionAttention(questionid) {
	$.getJSON("/faq/addQuestionAttention.json",{questionid:questionid}, function(result) {
		alert(result.message);
		if(result.flag==1){
			window.top.location.reload();
		}
	});
}

function isAnswerOfQuestion(questionid, answerid, isAnswer) {
	$.getJSON("/faq/setAnswer.json",{questionid:questionid,answerid:answerid,isAnswer:isAnswer}, function(result) {
		if(result.flag==1){
			window.top.location.reload();
		}else{
			alert(result.message);
		}
	});
}

function addAnswerRef(questionid, answerid, type) {
	$.getJSON("/faq/answerRef.json",{questionid:questionid,answerid:answerid,type:type}, function(result) {
		if(result.flag==1){
			window.top.location.reload();
		}else{
			alert(result.message);
		}
	});
}
